package yatan.common.utility;

public final class ParamUtility {
    private ParamUtility() {
    }

    public static void checkNull(Object obj, String name) {
        if (obj == null) {
            throw new IllegalArgumentException("The object " + name + " cannot be null.");
        }
    }

    public static void checkStringNullEmpty(String str, String name) {
        if (str == null || str.trim().length() == 0) {
            throw new IllegalArgumentException("The string " + name + " cannot be null or empty.");
        }
    }

    public static void checkState(Object obj, String name) {
        if (obj == null) {
            throw new IllegalStateException("The object " + name + " cannot be null.");
        }
    }
}
